package News.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class HTTPServlet extends HttpServlet {
    protected void doGet(HttpServletRequest rq, HttpServletResponse rs) throws IOException, ServletException {
        String name=(String)rq.getParameter("name");
        boolean judge=false;
        if("123".equals(name)){
            judge=true;
        }else{
            judge=false;
        }
        rs.setContentType("text/html;charset=UTF-8");
        PrintWriter pw=rs.getWriter();
        pw.print(judge);
        pw.flush();
        pw.close();
    }
    protected void doPost(HttpServletRequest rq, HttpServletResponse rs) throws IOException, ServletException {
        this.doGet(rq,rs);
    }

}
